<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title><bean:message key="title.head.query" /></title>
</head>
<body>
<form id="stockForm" method="post">
<c:if test="${sessionParameterTest == 'valueInSession'}">These is value in Session!It's implemented by JSTL and session.</c:if>
<table align="center">
	<tr>
		<td align="right"><bean:message key="label.stock.num" /></td>
		<td align="left"><input type="text" name="num"
			value="${stockVO.num}" style="width: 150px" /></td>
	</tr>
	<tr>
		<td align="right"><bean:message key="label.stock.name" /></td>
		<td align="left"><input type="text" name="name"
			value="${stockVO.name}" style="width: 150px" /></td>
	</tr>
	<tr>
		<td align="right"><bean:message key="label.stock.price" /></td>
		<td align="left"><input type="text" name="price"
			value="${stockVO.price}" style="width: 150px" /></td>
	</tr>
	<tr>
		<td>
		<input type="button" onclick="submitToUpdate();" value="<bean:message key="label.button.update"/>"/>
		<input type="button" onclick="submitToDelete();" value="<bean:message key="label.button.delete"/>"/>
		</td>
		<td><input type="button"
			onclick="window.location.href='index.do';"
			value="<bean:message key="label.button.back"/>"></td>
	</tr>
</table>
</form>
</body>
</html>

<script language="javascript">
	function submitToUpdate() {
		var stockForm = document.getElementById("stockForm");
		stockForm.action = "stockUpdate.do";
		stockForm.submit();
	}
	function submitToDelete() {
		var stockForm = document.getElementById("stockForm");
		stockForm.action = "stockDelete.do";
		stockForm.submit();
	}

</script>